using ChuTiJingTai.Models;

namespace ChuTiJingTai.Services
{
    /// <summary>
    /// 本地存储服务接口
    /// </summary>
    public interface ILocalStorageService
    {
        // 孩子档案管理
        Task<List<ChildProfile>> GetChildrenAsync();
        Task<ChildProfile?> GetChildAsync(int id);
        Task<int> SaveChildAsync(ChildProfile child);
        Task<bool> DeleteChildAsync(int id);

        // API配置管理
        Task<ApiConfig?> GetApiConfigAsync();
        Task SaveApiConfigAsync(ApiConfig config);

        // 试卷管理
        Task<List<ExamPaper>> GetExamPapersAsync();
        Task<List<ExamPaper>> GetExamPapersByChildAsync(int childId);
        Task<ExamPaper?> GetExamPaperAsync(int id);
        Task<int> SaveExamPaperAsync(ExamPaper paper);
        Task<bool> DeleteExamPaperAsync(int id);

        // 日志管理
        Task<List<LogEntry>> GetLogsAsync();
        Task<List<LogEntry>> GetLogsByLevelAsync(string level);
        Task AddLogAsync(LogEntry log);
        Task ClearLogsAsync();

        // 通用方法
        Task<T?> GetItemAsync<T>(string key);
        Task SetItemAsync<T>(string key, T value);
        Task RemoveItemAsync(string key);
        Task ClearAllAsync();
    }
} 